//
//  DPWalletOperationCell.swift
//  DoctorEPlus
//
//  Created by 王林波 on 2021/3/8.
//

import UIKit

class DPWalletOperationCell: UITableViewCell {

    @IBOutlet weak var bottom_line: UILabel!
    
    @IBOutlet weak var operation_name_label: UILabel!
    
    @IBOutlet weak var date_label: UILabel!
    
    // 收入或支出金额 ， 支出normal，收入highed
    @IBOutlet weak var money_label: UILabel!
    
    // 余额
    @IBOutlet weak var last_label: UILabel!
    
    var model: DPWalletFlowItemModel! {
        didSet {
            self.operation_name_label.text = model.title
            self.date_label.text = model.time
            self.date_label.text = model.date
            self.last_label.text = "余额： "+model.balance
            self.last_label.isHighlighted = model.type == 1
            if model.type == 1 {
                self.money_label.text = "+"+model.amount
            }else {
                self.money_label.text = "-"+model.amount
            }
        }
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    static var cellHeight: CGFloat {
        get {
            return 70
        }
    }
}
